package com.san.hkhospital.service.impl;

import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.san.hkhospital.mapper.AccountMapper;
import java.util.List;
import java.util.Map;

import com.san.hkhospital.entity.Account;
import com.san.hkhospital.entity.AccountExample;
import com.san.hkhospital.service.AccountService;
import org.springframework.transaction.annotation.Transactional;

/**
 * ClassName:AccountServiceImpl
 * PackageName:com.san.hkhospital.service.impl
 * Description:
 *
 * @Author:yy
 * @CreatedAt:2024/11/13 14:38
 * 
 */
 
 @Transactional
@Service
public class AccountServiceImpl implements AccountService{

    @Resource
    private AccountMapper accountMapper;

    @Override
    public long countByExample(AccountExample example) {
        return accountMapper.countByExample(example);
    }

    @Override
    public int deleteByExample(AccountExample example) {
        return accountMapper.deleteByExample(example);
    }

    @Override
    public int deleteByPrimaryKey(Integer accId) {
        return accountMapper.deleteByPrimaryKey(accId);
    }

    @Override
    public int insert(Account record) {
        return accountMapper.insert(record);
    }

    @Override
    public int insertSelective(Account record) {
        return accountMapper.insertSelective(record);
    }

    @Override
    public List<Account> selectByExample(AccountExample example) {
        return accountMapper.selectByExample(example);
    }

    @Override
    public Account selectByPrimaryKey(Integer accId) {
        return accountMapper.selectByPrimaryKey(accId);
    }

    @Override
    public int updateByExampleSelective(Account record,AccountExample example) {
        return accountMapper.updateByExampleSelective(record,example);
    }

    @Override
    public int updateByExample(Account record,AccountExample example) {
        return accountMapper.updateByExample(record,example);
    }

    @Override
    public int updateByPrimaryKeySelective(Account record) {
        return accountMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Account record) {
        return accountMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Account> accountList() {

        return accountMapper.selectByExample(null);
    }

    @Override
    public boolean addAccount(Account account) {
        return accountMapper.insertSelective(account)>0?true:false;
    }

    @Override
    public List<Account> searchList(Map<String, String> params) {
        return accountMapper.searchAccount(params);
    }

}
